using System;
using System.Web;
using Habanero.Base;
using Habanero.BO;
using Habanero.Faces.VWG;
using log4net;
using <<BOPROJECT_NAME>>;

namespace <<NAMESPACE>>
{
    public class Global : HttpApplication
    {
    
        private static readonly ILog log = LogManager.GetLogger(typeof(Global));
        private readonly string _uiDefName;
		
        protected void Application_Start(object sender, EventArgs e)
        {
            try
            {
				GlobalRegistry.ApplicationName = "<<APPLICATION_NAME>>";
				GlobalRegistry.ApplicationVersion = "<<PROJECT_VERSION>>";
				HabaneroAppVWG habaneroApp = new HabaneroAppVWG(GlobalRegistry.ApplicationName, GlobalRegistry.ApplicationVersion);
				habaneroApp.ClassDefsXml = BOBroker.GetClassDefsXml();
				habaneroApp.Startup();
                // Uncomment the next line of code to use an "In Memory" data accessor (instead of your Database).
                //BORegistry.DataAccessor = new DataAccessorInMemory();
	    	}
            catch (Exception ex)
            {
                log.Error(ex.Message);
                throw;
            }
        }

        protected void Application_End(object sender, EventArgs e)
        {
        }
    }
}